<template>

	<el-table-column prop="machine_id" :label="$t('machine.code')" show-overflow-tooltip>
		<template #default="scope">
			{{ scope.row.machine_id || '--' }}
		</template>
	</el-table-column>

	<el-table-column prop="machine_name" :label="$t('machine.name')" show-overflow-tooltip>
		<template #default="scope">
			{{ scope.row.machine_name || '--' }}
		</template>
	</el-table-column>

	<el-table-column prop="empty_num" :label="$t('machine.lane')+'/'+ $t('machine.cargoChannel')" show-overflow-tooltip>
		<template #default="scope">
			{{ scope.row.empty_num || '0' }} / {{ scope.row.total_channel || '0' }}
		</template>
	</el-table-column>

	<el-table-column prop="empty_channel" :label="$t('machine.cargo')" show-overflow-tooltip>
		<template #default="scope">
			<el-link type="primary" :underline="false" @click="gotomac(scope.row)">
				{{ scope.row.empty_channel || '--' }}
			</el-link>
		</template>
	</el-table-column>

	<el-table-column prop="empty_ratio" :label="$t('machine.rat')+'%'">
		<template #default="scope">
			{{ scope.row.empty_ratio || '--' }}
		</template>
	</el-table-column>

</template>

<script lang="ts" setup>
import { useI18n } from 'vue-i18n'
const { t: $t } = useI18n()
import { useRouter } from "vue-router";
const router = useRouter()
let gotomac = (e) => {

	ElMessage({
		message: $t('message.going') + '...',
		type: 'success'
	})

	let query = {
		l: encodeURI(JSON.stringify({
			id: e.m_id,
			type: 'channel'
		}))
	}

	router.push({ path: '/machine/info/details_info', query: query })

}

</script>
